#!/usr/bin/env python3
# -*- coding: utf-8 -*-

'Python内置了logging 模块，非常方便的记录错误信息'

import logging


def foo(s):
    return 10 / int(s)


def bar(s):
    return foo(s) * 2


def main():
    try:
        bar('0')
    except Exception as e:
        logging.exception(e)


main()
